{{!

  Copyright (c) Meta Platforms, Inc. and affiliates.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

}}{{!

Usually included in places where a container item is being processed. You have
access to a C object and need to return or convert it to a Python object. The
type in this case is probably a type:list_elem_type, type:set_elem_type,
type:key_type, or type:value_type.

By convention, it assumes the c++ structure that is being manipulated is named
citem.

}}{{#type:iobuf?}}{{!
  }}_fbthrift_iobuf.IOBuf.create(c_vec[idx].get(), self){{!
}}{{/type:iobuf?}}{{!
}}{{#type:iobufRef?}}{{!
  }}_fbthrift_iobuf.IOBuf.create(c_vec[idx].get().get(), self){{!
}}{{/type:iobufRef?}}{{!
}}{{#type:flexibleBinary?}}{{!
  }}(<const char*>c_vec[idx].data())[:c_vec[idx].size()]{{!
}}{{/type:flexibleBinary?}}{{!
}}{{^type:hasCustomTypeBehavior?}}{{!
}}{{#type:bool?}}c_vec[idx]{{/type:bool?}}{{!
}}{{#type:byte?}}c_vec[idx]{{/type:byte?}}{{!
}}{{#type:i16?}}c_vec[idx]{{/type:i16?}}{{!
}}{{#type:i32?}}c_vec[idx]{{/type:i32?}}{{!
}}{{#type:i64?}}c_vec[idx]{{/type:i64?}}{{!
}}{{#type:double?}}c_vec[idx]{{/type:double?}}{{!
}}{{#type:float?}}c_vec[idx]{{/type:float?}}{{!
}}{{#type:string?}}__init_unicode_from_cpp(c_vec[idx]){{/type:string?}}{{!
}}{{#type:binary?}}bytes(<string>c_vec[idx]){{/type:binary?}}{{!
}}{{^type:base?}}{{^type:enum?}}{{^type:list?}}{{!
    }}{{> types/cython_python_type}}._create_FBTHRIFT_ONLY_DO_NOT_USE({{!
    }}make_shared[{{> types/cython_cpp_type }}](c_vec[idx])){{!
}}{{/type:list?}}{{/type:enum?}}{{/type:base?}}{{!
}}{{#type:list?}}{{> types/container_from_cpp }}(c_vec[idx]){{/type:list?}}{{!
}}{{#type:enum}}translate_cpp_enum_to_python({{!
    }}{{> types/cython_python_type}}, <int> c_vec[idx]){{/type:enum}}{{!
}}{{/type:hasCustomTypeBehavior?}}
